package com.wnhz.trim.construction.service.controller;

import com.wnhz.trim.common.result.HttpResp;
import com.wnhz.trim.construction.service.service.BuildService;
import com.wnhz.trim.domain.entity.Build;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "装修部模块接口")
@RestController
@RequestMapping("/api/Build")
public class BuildController {
    @Autowired
    private BuildService bs;


    @ApiOperation(value = "添加装修反馈",notes = "添加装修反馈接口")
    @PostMapping("addBuild")
    public HttpResp addBuild(Build Build){
        bs.add(Build);
        return HttpResp.success("新增装修反馈信息完成");
    }

    @ApiOperation(value = "根据ID删除装修反馈信息")
    @DeleteMapping("deleteBuild")
    public HttpResp deleteBuild(int id){
        bs.delete(id);
        return HttpResp.success("删除装修反馈信息息完成");
    }

    @ApiOperation(value = "修改装修反馈信息接口")
    @PutMapping("updateBuild")
    public HttpResp updateBuild(Build Build){
        bs.update(Build);
        return HttpResp.success("修改装修反馈信息信息完成");
    }

    @ApiOperation(value = "装修反馈信息全查询")
    @GetMapping("findAllBuild")
    public HttpResp findAllBuild(){
        bs.findAll();
        return HttpResp.success(bs.findAll());
    }

    @ApiOperation(value = "根据姓名模糊查找装修工")
    @GetMapping ("findByNameLike")
    public HttpResp findByNameLike(String name){
        return HttpResp.success(bs.findByNameLike(name));
    }

 
}
